package com.kma.summer2012.server.proxy;

import com.kma.summer2012.model.CrumbsUser;
import com.kma.summer2012.shared.model.UICrumbsUser;

/**
 * Created by IntelliJ IDEA.
 * User: Администратор
 * Date: 15.01.13
 * Time: 23:57
 * To change this template use File | Settings | File Templates.
 */
public class Proxy {
    private static Proxy instance;

    private Proxy(){
    };

    public static Proxy getInstance(){
        if (instance==null) {
            instance=new Proxy();
        }
        return instance;
    }

    public UICrumbsUser createFromUser(CrumbsUser user) {
        UICrumbsUser uiCrumbsUser = new UICrumbsUser();
        uiCrumbsUser.setUserId(user.getUserId());
        uiCrumbsUser.setLogin(user.getLogin());
        uiCrumbsUser.setPassword(user.getPassword());
        uiCrumbsUser.setPosition(user.getCrumbsPosition().getName());
        uiCrumbsUser.setSurnmNmSecondnm(user.getSurnmNmSecondnm());
        return uiCrumbsUser;
    }
}
